#ifndef DOWNLOADCONFIGMANAGER_H
#define DOWNLOADCONFIGMANAGER_H

#include <QObject>
#include <QSettings>
#include "downloadobject.h"

class QFile;
class QDomDocument;

class  DownloadConfigManager : public QObject
{
public:
    explicit DownloadConfigManager(QObject *parent = 0);
    ~DownloadConfigManager();

    inline bool initXMLConfig(){ return readConfig(COFIGPATH); }
    void writeXMLConfig();

    inline QString readBackgroundTheme()
    { return readXmlByTagNameAndAttribute("bgTheme"); }
    inline QString readBackgroundTransparent()
    { return readXmlByTagNameAndAttribute("bgTransparent"); }

protected:
    bool readConfig(const QString& type);
    QString readXmlByTagNameAndAttribute(const QString&);

    QFile* m_file;
    QDomDocument* m_ddom;

};

#endif // DOWNLOADCONFIGMANAGER_H
